package com.bmf.file.controller;

import com.bmf.file.utils.DownloadFileUtil;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping("file")
public class DownloadController {
    @CrossOrigin // 跨域允许所有
    @GetMapping(value = "download")
    public void download(@RequestParam("filePath")String filePath, HttpServletResponse response){
        DownloadFileUtil.downloadLocal(filePath,response);
    }
}
